/**
 * 实现LED灯的交替闪烁
 */
#include <REGX52.H>
void delay_ms(unsigned int ms)
{
    unsigned int i, j;
    for (i = 0; i < ms; i++)
    {
        for (j = 0; j < 123; j++)
            ;
    }
}

void main()
{
    P0_0 = 0;
    P0_6 = 1;
    while (1)
    {
        P0_0 = ~P0_0;
        P0_6 = ~P0_6;
        delay_ms(150);
    }
}